import { createApp } from "vue";
import LoginComponent from "./index.vue";

export function Login(cb = null) {
  const container = document.createElement("div");
  const instance = createApp(LoginComponent, {
    modelValue: true,
    onClose() {
      instance.unmount(container);
      document.body.removeChild(container);
    },
    successCb: cb,
  });
  container.classList.add("test");
  document.body.appendChild(container);
  instance.mount(container);
  return instance;
}
